using Holoville.HOTween;
using Holoville.HOTween.Core;
using UnityEngine;

public class MarkAnimation : MonoBehaviour
{
	public UIWidget widget;

	public bool isFree;

	public Vector3 position;

	private float? angle;

	private void Start()
	{
		HOTween.Init();
	}

	private void Update()
	{
		if (isFree)
		{
			angle = HitMarks.instance.RotateDamage(position);
			widget.transform.eulerAngles = new Vector3(0f, 0f, -1f * angle.Value);
		}
	}

	public void Init(float duration)
	{
		if (!(widget == null))
		{
			HOTween.Kill(widget);
			HOTween.To(widget, duration, new TweenParms().Prop("alpha", 0));
		}
	}

	public void InitArrow(float duration)
	{
		if (!(widget == null))
		{
			HOTween.Kill(widget);
			HOTween.To(widget, duration, new TweenParms().Prop("alpha", 0).OnComplete((TweenDelegate.TweenCallback)delegate
			{
				isFree = false;
			}));
		}
	}
}
